<template>
	<view>
		<navbar title="数据管理" :isbg="false" :opacity='1' :autoBack="true" bg='#fff'></navbar>
		<scroll-view scroll-y="true" class="scbox">
			<view class="con">
				<u-swiper :list="list1" height="264rpx" radius='30rpx' bgColor="transparent"></u-swiper>
				<view class="con__list">
					<view class="con__list__item" v-for="(item,index) in list" :key="index" @click="navto(item.url)">
						<image :src="'/static/data/t'+index+'.png'" class="con__list__item__icon" mode=""></image>
						{{item.text}}
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import datagl from '@/api/_datagl.js'
	export default {
		data() {
			return {
				list1: [],
				list: [
					{text: '增加数据',url: '/pages/datagl/adddata'},
					{text: '数据管理',url: '/pages/datagl/manage'},
					{text: '交易管理',url: '/pages/personal/transaction'},
					{text: '交易统计',url: '/pages/datagl/statistics'},
					{text: '定位考勤',url: '/pages/datagl/attendance'},
					{text: '通知消息',url: '/pages/datagl/msg'},
					{text: '库存查询',url: '/pages/datagl/inventory'},
					{text: '人员查询',url: '/pages/datagl/staff'},
				 ]
			};
		},
		methods:{
			async getbanner(){
				this.list1=[]
				let res = await datagl.readConfig({configName:'databanner'})
				if(res.data.code==1){
					res.data.data.databanner.map(t=>{
						this.list1.push(this.URL(t))
					})
				}
			}
		},
		onLoad() {
			this.getbanner()
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #F8F8F8;
	}
	.con {
		padding: 20rpx 30rpx;

		&__list {
			display: flex;
			align-items: center;
			justify-content: space-between;
			flex-wrap: wrap;
			margin-top: 30rpx;
			background: #FFFFFF;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			padding: 30rpx;
			&__item{
				width: 303rpx;
				height: 115rpx;
				background: #F3F8FE;
				border-radius: 20rpx 20rpx 20rpx 20rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-family: PingFang-SC, PingFang-SC;
				font-weight: bold;
				font-size: 30rpx;
				color: #010101;
				margin-bottom: 30rpx;
				&__icon{
					width: 91rpx;
					height: 91rpx;
					margin-right: 26rpx;
				}
			}
		}
	}
</style>